<script>
import { defineComponent, getCurrentInstance } from "vue";

export default defineComponent({
  props: {
    that: Object,
  },
  setup(props) {
    return { that: props.that };
  },
  render() {
    let that = this.that;
    return (
      <div class="styleValue">
        <span>图片选择</span>
        <a-button
          type="primary"
          ghost
          size="small"
          onClick={async () => {
            await this.$store.commit("uploadImage", {
              jud: false,
              that,
              fn: (data, err) => {
                if (err && data.length != 0) return;
                this.$store.commit("aimAttrsChange", {
                  newValue: data[0],
                  attrsName: "imageUrl",
                  that,
                });
              },
            });
          }}
        >
          选择本地图片
        </a-button>
      </div>
    );
  },
});
</script>
